package com.aaa.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author whj
 * @since 2023-01-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class GGoods implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 商品主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品名称
     */
    private String gname;

    /**
     * 商品图片
     */
    private String img;

    /**
     * 商品描述
     */
    private String remark;

    /**
     * 商品品牌
     */
    private Integer brandid;

    /**
     * 商品类别
     */
    private Integer sortid;

    /**
     * 储藏方式
     */
    private Integer depositid;

    /**
     * 商品单位
     */
    private Integer unitid;

    /**
     * 上架时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime addtime;

    /**
     * 保质期
     */
    private LocalDateTime expirationtime;

    /**
     * 商品状态0审核通过 1驳回 2待审核
     */
    private Integer state;

    /**
     * 上下架 0上架 1下架
     */
    private Integer status;

    /**
     * 商家id
     */
    private String bid;

    /**
     * 价格
     */
    private String price;

    /**
     * 逻辑删除
     */
    private Integer isdeleted;

    /**
     * 驳回理由
     */
    private String checkContent;


    //
    //    // 对应的商家
    @TableField(exist = false)
    private BBusinessInfo businessInfo;

    @TableField(exist = false)
    private GUnit unit;

    @TableField(exist = false)
    private Integer num;
//    @TableField(exist = false)
//    private String bicon;
//    @TableField(exist = false)
//    private String sname;

    @TableField(exist = false)
    private String brandname;

    @TableField(exist = false)
    private String sortname;

    @TableField(exist = false)
    private String depositname;

    @TableField(exist = false)
    private String unitname;
}
